Psycle MIDI
(controlling Psycle using MIDI input)
by Mark McCormack
(mark_jj_mccormak@yahoo.co.uk / ICQ #115046014)

 
Internal MIDI Implementation v2.2 beta (Psycle Release 1.5xx)

 

Contents:

A. Features
- - - - - - - - - - - -
1. How do I control Psycle from my MIDI sequencer ?
2. Can I use a sequencer instead of the internal Psycle tracker?
3. Can I mix using Psycle MIDI sounds and other synth/MIDI modules all controlled by my sequencer?
4. Can I mix using a sequencer with the internal tracker?
5. How do I see what is going on with Psycle's MIDI interface?
6. Can I record MIDI triggered Psycle audio using the internal Psycle WAV recording facility?
7. Why does the real-time MIDI not work with the DirectSound audio driver?
8. What can I do if my MIDI sequencer does not support a MIDI sync clock?
9. Tips & Tricks
10. Known Bugs
- - - - - - - - - - - -
B. Limitations
C. MIDI Implementation Chart


A. Features

You can now control the excellent Psycle next-generation tracker via MIDI, rather than using the built-in classic tracker interface (treat it like a MIDI softsynth). MIDI note on/off messages can be mapped to any generator and instrument across all 16 MIDI channels. You can also select any instrument for that channel, when using a Sampler generator. Psycle Plug-in and VST parameters (both generator AND effect) can be controlled by using MIDI continous controller messages. If you still wish to use the internal 'tracker sequencer', then you can use still use MIDI input to insert notes into patterns from an external MIDI keyboard.

1. How do I control Psycle from my MIDI sequencer ?

This is fairly easy once you understand the basic concept. You will need to setup what is known as a Virtual MIDI port. This is a software emulated MIDI input/output port (yes, a port which does both!). You will need software such as Hubi's Loopback or MIDI Yoke to create this virtual port. Personally, I prefer MIDI Yoke as it has been in my experience more stable - however - many people swear by Hubi. If you are using Win2000/NT then MIDI Yoke is what you need - as at time of writting Hubi's does not work under these NT derived platforms.

Once you have setup this virtual MIDI port you simply select this port as the OUTPUT from your MIDI sequencer and also select this port as the INPUT into Psycle (find this in Configuration->Output tab). To create a pipe of MIDI data from the sequencer to Psycle thus:

[MIDI Sequencer Out] -----> [Virtual MIDI Port (e.g. MIDI Yoke)] -----> [Psycle MIDI In]

And you should now be able to control the generators of Psycle with your MIDI sequencer! For futher explanation see the configuration dialog of Psycle below:

Psycle Configuration Dialog

Select the main input device from one of those available in the Input Device listbox. This should match the Output MIDI Device of your MIDI sequencer. If you wish to alter the midi headroom available for midi input (see later for details) then you can do so by entering a value directly or by using the spin buttons to quickly increment/decrement the current value. If you are using a separate device for MIDI Sync (see later for details) then you can select this from the Sync Device listbox, although if you plan to send a MIDI Sync clock through the same device as the main input device then you can leave this unselected (None).

2. Can I use a sequencer instead of the internal Psycle tracker?

Yes. During a lot of testing this proved very stable and you should get good results.

3. Can I mix using Psycle MIDI sounds and other synth/MIDI modules all controlled by my sequencer?

Yes. Since the previous Alpha implementation, one of the main improvements to Psycle's MIDI support has been the addition of some rather complex syncronisation code. This allows fairly stable and usable syncronisation between Psycle generated audio and that generated by other synth/MIDI modules. You will probably need to offset your non-Psycle MIDI/Audio tracks (in your sequencer) to align with the Psycle generator audio, but as long as you utilise sending some MIDI sync codes (or emulated sync) to Psycle you should keep the sync between the sequencer and Psycle. This is usually referred to as Transmit MIDI Start/Continue/Stop/Clock or similar.

To enable MIDI sync in CakeWalk:

CakeWalk Sync Dialog

Some sequencers (CakeWalk included) allow you to send a MIDI Sync Start code when playback is start from any point in the song (not just the very beginning). This is usually referred to as Use Start, Never Continue or similar. If your sequencer has this facility it is recommed that you enable this in order to force Psycle to resync with the audio engine every time sequencer playback is initiated.

4. Can I mix using a sequencer with the internal tracker?

Not really. The MIDI implementation has not been designed in any way to be used in conjunction with the internal tracker. When the pattern view is active in Psycle then all MIDI note-on messages are entered into the pattern (like when using the PC keyboard). It is possible to (for instance) play generators with the tracker interface and control the generator parameters with external MIDI controllers (e.g. using Phatboy hardware device). Remember the controller->generator parameter must firstly be set (using CC 126/127).

5. How do I see what is going on with Psycle's MIDI interface?

MIDI implementations of v2.2b or better provide a MIDI Monitor Dialog to allow you to see the current state of Psycle's MIDI interface. The dialog is shown below with a short explanation of all the values shown:

Psycle MIDI Monitor Dialog

Buffer Used - The amount of MIDI events currently waiting in the internal MIDI buffer.

Buffer Capacity - The maximum number of MIDI events the internal MIDI buffer can hold (currently fixed at 1024).

Events Lost - The number of MIDI events purged (not played) from the internal MIDI buffer. This usually happens when there is a "drop-out" in the audio pipe-line and the MIDI interface decides that the events should be disguarded rather than played (because they probably have been delayed too much).

MIDI Headroon - How much "MIDI slack" is being allowed to account for delayed MIDI messages getting to Psycle (set in the configuration dialog).

Internal MIDI Version - The descriptor of the currently running Psycle MIDI interface code.

Sync Event Latency - The amount of milliseconds the MIDI Sync Start message was delayed.

Sync Adjust - The amount of samples Psycle has accounted for to bring its audio engine in line with the incomming MIDI data. A negative value here means that some notes may have been purged from the MIDI buffer to regain sync (not too good). A positive value here means that Psycle had time to wait until it needed to start playing the received MIDI data (good).

Sync Offset - The current amount of milliseconds that the Psycle audio engine has "lagged" behind the incomming MIDI. This typically should start around 0 and then being greater (negative) if the audio engine "drops-out" at any point. This value is used internally to keep the audio engine in sync with an external MIDI sequencer.

Psycle MIDI active? - Is Psycle using the MIDI input?

Receiving MIDI data? - Is Psycle receiving any MIDI data, either on the main device or the sync device?

Syncronising - Is Psycle currently syncronising the audio engine with the incomming MIDI?

Resync Triggered? - Has a resync been triggered because the audio engine has been restarted? (e.g. when a new plug-in is created)

Emulated Track Tick? - Has Psycle received a tracker tick? (CC 123, DATA 1-127 - simulates a tracker line change)

MIDI Sync Start/Clock/Stop - Has Psycle received one of these MIDI sync messages?

Emualted Sync Start/Clock/Stop - Has Psycle received one of the emulated sync messages? (CC 121, 122 & 124)

Ch 1-16 - Shows the data received for each MIDI channel (included ALL types of data).

(The channel-mapping table is self-explanatory)

6. Can I record MIDI triggered Psycle audio using the internal Psycle WAV recording facility?

In a word - No. However, virtually all sound cards these days support the ability to record what is being played. There would be no advantage to being able to record MIDI triggered audio using Psycle, as we would still be reliant on receiving MIDI externally!

7. Why does real-time MIDI not appear to work with the DirectSound audio driver?

The current implementation of the DirectSound interface support in Psycle does not provide the necessary information to the MIDI interface in order to enable decent syncronisation between the MIDI and the audio engine. Therefore, until the DirectSound code is updated the MIDI interface will NOT work (in real-time) with DirectX audio. Sorry!

8. What can I do if my MIDI sequencer does not support a MIDI sync clock?

If your sequencer does not support outputing a MIDI clock, then you can use three controllers to simulate a clock using a standard MIDI track. Place a CC 121 as the first event in the song (preferably leaving a bar gap between it and the next midi event). Then every regular interval (say 1/16th of a bar) place a CC 122. You can send these events through any channel and setting a generator/instrument map is not required. Finally, to stop all sound, place a CC 124 right at the end of your song.

9. Tips & Tricks?

 

10. Known Bugs

The MIDI interface to Psycle, although heavily developed and tested, is still Beta. Something as complex as syncronising two applications down to millisecond timing is always going to be difficult. There is currently still a random bug that occasionally occurs when creating a new generator/effect. This bug means the MIDI interface fails to resync with the audio engine and the MIDI buffer fills up, without any notes being played. Until this bug is fixed, should this occur, the work around is simply to send a MIDI Sync Start code to Psycle (e.g. restart playback from the start of the song on your MIDI sequencer).


B. Limitations

Currently the main limitations of the MIDI input offered by Psycle are relating to the delay in the MIDI getting into Psycle (through Microsoft Windows) and, in a way, any audio engine drop-outs. Audio engine drop-outs are nothing to do with the MIDI interface, and can usually be rectified (or made much better) by increasing the number of audio buffers and/or the size of these buffers. To account for delays in MIDI messages getting to Psycle the amount of midi headroom (in milliseconds) is user-configurable. If you are experiencing a lot of lost messages and/or poor syncronisation then try increasing this value. The default is 100 milliseconds, but on slower systems or systems that are running a lot of heavy-duty applications concurrently with Psycle, it may be wise to increase this value. This will increase the audio latency, but the MIDI will be more stable and predictable.

C. MIDI Implementation Chart

PsycleMIDIChart.TXT (raw text)

Notes

Controllers 126 & 127 are used as a compound controller. They are used together to set up a link between any free controller (CC 1-120) and a generator parameter on the channel. For example, to map CC 32 to the channels generator parameter 15 use:

CC 126, DATA 32 (followed by)
CC 127, DATA 15

The parameters of Psycle Plug-ins & VST machines (both Generators AND effects) can be mapped. It is usually not wise to map recognised MIDI controllers (e.g. Volume is CC 7) to generator parameters, although mapping CC 7 to a generator's Master Volume parameter does make perfect sense!

Note that the values of Psycle generators are displayed in Hexidecimal (e.g. 0f in hex is 15 is decimal/sequencer).

'Note Off' messages are by default ignored, enable them using Controller 125, DATA 127.

To use effects such as the GoaSlicer you will need to have a track sending tick-sync controllers to give the sync usually provided by the tracker. This is very easy, simply send (any channel, any patch, ...) a Controller 123, DATA 127 on every 1/16th note to simulate the typical required sync. In sequencers such as CakeWalk, you can simply create one bar of this sync pattern and then set the Loop parameter to some high value to ensure this pattern is sent every bar.

Make sure the internal tempo of Psycle matches that of your MIDI sequencer.

(21st April 2001)